package com.webapp.model;

import java.sql.Date;
import java.text.DateFormat;
import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Advertisement {
	private static final int DateFormat = 0;
	private int advertisementId;
	private int employeeId;
	private String type;
	private String date;
	private String company;
	private String itemName;
	private String content;
	private int price;
	private int units;
	
	public Advertisement(int employee, String type, String company, String name, String content, int price, int units) {
		this.advertisementId = new Double( Math.random() * 100000 ).intValue();
		this.employeeId = employee;
		this.type = type;
		this.company = company;
		this.itemName = name;
		this.content = content;
		this.price = price;
		this.units = units;
		DateFormat dateFormat = new SimpleDateFormat("yyyy/MM/dd HH:mm:ss");
		Calendar cal = Calendar.getInstance();
		this.date = dateFormat.format(cal.getTime());		
	}
	
	public Advertisement(){}
	
	public int getAdvertisementId() {return advertisementId;}
	public int getEmployeeId() {return employeeId;}
	public String getType() {return type;}
	public String getDate() {return date;}
	public String getCompany() {return company;}
	public String getItemName() {return itemName;}
	public String getContent() {return content;}
	public int getPrice() {return price;}
	public int getUnits() {return units;}
	
	public void setAdvertisementId(int advertisementId) {this.advertisementId = advertisementId;}
	public void setEmployeeId(int employeeId) {this.employeeId = employeeId;}
	public void setType(String type) {this.type = type;}
	public void setDate(String date) {this.date = date;}
	public void setCompany(String company) {this.company = company;}
	public void setItemName(String itemName) {this.itemName = itemName;}
	public void setContent(String content) {this.content = content;}
	public void setPrice(int price) {this.price = price;}
	public void setUnits(int units) {this.units = units;}
}
